<template>
  <tr>
    <td>合计:</td>
    <td colspan="5">{{ sum }}</td>
  </tr>
</template>

<script>
export default {
  props: {
    goodList: Array,
  },
  computed: {
    sum() {
      return this.goodList.reduce(
        (sum, item) =>
          item.checked ? (sum = sum + item.price * item.num) : sum,
        0
      )
    },
  },
}
</script>

<style></style>
